From: Cosimo Cecchi Date: Thu, 3 Jan 2013 14:02:00 +0000 (+0100) Subject: screenshot: use g_file_replace() when using an absolute path X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5112 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e4860acb5815d245c00554367d6ffcd18a7523b7;p=gnome-shell.git screenshot: use g_file_replace() when using an absolute path Instead of g_file_create(), which always fails if the file exists already. --- diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c index 4078ccd56..2914e0705 100644 --- a/src/shell-screenshot.c +++ b/src/shell-screenshot.c @@ -153,7 +153,7 @@ prepare_write_stream (const gchar *filename, { file = g_file_new_for_path (filename); *filename_used = g_strdup (filename); - stream = G_OUTPUT_STREAM (g_file_create (file, G_FILE_CREATE_NONE, NULL, NULL)); + stream = G_OUTPUT_STREAM (g_file_replace (file, NULL, FALSE, G_FILE_CREATE_NONE, NULL, NULL)); g_object_unref (file); } else